﻿using System.Collections.Specialized;
using System.Xml;
using SqlMapper.SqlElements;

namespace SqlMapper.Serializers
{
    public sealed class IsLessEqualDeSerializer : IDeSerializer
    {
        public BaseTag Deserialize(XmlNode node)
        {
            IsLessEqual isLessEqual = new IsLessEqual();

            NameValueCollection prop = NodeUtils.ParseAttributes(node);
            isLessEqual.Prepend = NodeUtils.GetStringAttribute(prop, "prepend");
            isLessEqual.Property = NodeUtils.GetStringAttribute(prop, "property");
            isLessEqual.CompareProperty = NodeUtils.GetStringAttribute(prop, "compareProperty");
            isLessEqual.CompareValue = NodeUtils.GetStringAttribute(prop, "compareValue");
            isLessEqual.Sql = NodeUtils.GetStringAttribute(prop, "sql");

            return isLessEqual;
        }
    }
}
